const bcrypt = require('bcryptjs');
const saltRounds = 10;

//生成盐
const salt = bcrypt.genSaltSync(saltRounds);
//根据盐进行加密
const hash = bcrypt.hashSync("console.log(dy)", salt);
console.log(bcrypt.compareSync("console.log(dy2)", hash));